<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>个人资料</title>
		<%include("/common/include.html"){}%>
		<style type="text/css">
			ul li{
				display: inline-block;
				margin-left: 50px;
				margin-top:20px;
			}
			#main{
				margin:0 auto;
				width: 800px;
				height:auto;
				position: relative;
				padding-top:50px;
			}
		</style>
	</head>
	<body>
		<form id="personalInformationForm"   action="${cxt!}/personalInformation/info" method="post">
			<ul id="main">
				<input type="hidden" id="personalInfoIds" name="intoPersonnel.userIds" value="${user.ids!}">
				<li style="margin-left: 88px;">
					<span>姓名</span>
					<input id="name" class="easyui-textbox theme-textbox-radius" name="user.name" style="width: 130px;height:35px;text-align: center;" value="${user.name!}" readonly>
				</li>		
				<!-- <li style="margin-left: 63px;">
					<span>性别</span>
					<select id="sex" name="intoPersonnel.sex"  class="easyui-combobox theme-textbox-radius" style="width: 130px;height:35px;text-align: center;" select="${intoPersonnel.sex!}">
						<option value="男">男</option>
						<option value="女">女</option>
					</select>
				</li>
				<li style="margin-left: 65px;">
					<span>出生日期</span>
					<input id="birthday" name="intoPersonnel.personnel_birthday" class="easyui-datebox inputBox theme-textbox-radius" data-options="sharedCalendar:'#cc'" style="height: 35px;width: 130px;text-align: center;" value="${intoPersonnel.personnel_birthday!}">
				</li>
				<div id="cc" class="easyui-calendar"></div>
				<br />
				<li style="margin-left: 88px;margin-top: 5px">
					<span>身高</span>
					<input id="height" name="intoPersonnel.height" class="easyui-textbox theme-textbox-radius" style="width: 130px;height:35px;text-align: center;" value="${intoPersonnel.height!}">
				</li>
				<li style="margin-left: 64px;">
					<span>体重</span>
					<input id="weight" name="intoPersonnel.weight" class="easyui-textbox theme-textbox-radius" style="width: 130px;height:35px;text-align: center;" value="${intoPersonnel.weight!}">
				</li>
				<li style="margin-left: 88px;">
					<span>民族</span>			
					<#code type="select" id="nation_select" name="intoPersonnel.nation" code="code_nation" defaultCode="${intoPersonnel.nation! }"  class="easyui-combobox inputBox theme-textbox-radius" style="width: 130px;height:35px;text-align: center;"/>
				</li>
				<br />
				<li style="margin-left: 64px;margin-top: 5px">
					<span>政治面貌</span>
					<#code type="select" id="zzmm_select" name="intoPersonnel.politics_status" code="code_zzmm" defaultCode="${intoPersonnel.politics_status! }"  class="easyui-combobox inputBox theme-textbox-radius" style="width: 130px;height:35px;text-align: center;"/>
				</li>
				<li style="margin-left: 40px;">
					<span>婚姻状况</span>
					 <#code type="select" id="hyzk_select" name="intoPersonnel.marital_status" code="code_marry" defaultCode="${intoPersonnel.marital_status! }"  class="easyui-combobox inputBox theme-textbox-radius" style="width: 130px;height: 35px;text-align: center;"/> 
				</select>
				</li>
				<li style="margin-left: 64px;">
					<span>健康状况</span>
					<#code type="select" id="jk_select" name="intoPersonnel.health_condition" code="code_jkzk" defaultCode="${intoPersonnel.health_condition! }"  class="easyui-combobox inputBox theme-textbox-radius" style="width: 130px;height: 35px;text-align: center;"/> 
				</select>
				</li>
				<br />
				<li style="margin-left: 88px;margin-top: 5px">
					<span>专业</span>
					<input id="major" name="intoPersonnel.major" class="easyui-textbox theme-textbox-radius date"  style="width: 130px;height: 35px;text-align: center;"value="${intoPersonnel.major! }">
				</li>
				<li style="margin-left: 64px;">
					<span>学历</span>
					<#code type="select" id="xl_select" name="intoPersonnel.education_background" code="code_xl" defaultCode="${intoPersonnel.education_background! }"  class="easyui-combobox inputBox theme-textbox-radius" style="width: 130px;height:35px;text-align: center;"/>
				</li>
				<li style="margin-left: 52px;">
					<span>计算机水平</span>
					<#code type="select" id="jsj_select" name="intoPersonnel.computer_skill" code="code_jsjsp" defaultCode="${intoPersonnel.computer_skill! }"  class="easyui-combobox inputBox theme-textbox-radius" style="width: 130px;height:35px;text-align: center;"/>
				</li>
				<br />
				<li style="margin-left: 64px;margin-top: 5px">
					<span>毕业学校</span>
					<input id="school" name="intoPersonnel.graduation_school" class="easyui-textbox theme-textbox-radius date" style="width: 130px;height: 35px;text-align: center;"value="${intoPersonnel.graduation_school! }">
				</li>
				<li style="margin-left: 40px;">
					<span>身份证号</span>
					<input id = "idCard" name="intoPersonnel.idcard"class="easyui-textbox theme-textbox-radius date" style="width: 130px;height: 35px;text-align: center;"value="${intoPersonnel.idcard! }">				
				</li> -->
				<li style="margin-left: 76px;">
					<span>手机号</span>
					<input id="phone" class="easyui-textbox theme-textbox-radius date" style="width: 130px;height: 35px;text-align: center;" name="user.name" value="${user.mobile! }" readonly>
				</li>
				<br />
				<!-- <li style="margin-left: 64px;">
					<span>联系住址</span>
					<#code type="select" id="xzqh_select" name="intoPersonnel.province" code="code_xzqh" defaultCode="${intoPersonnel.province! }"  class="easyui-combobox inputBox theme-textbox-radius" style="width: 149px;height: 35px;text-align: center;"/>
					<input id="city_input" type="hidden" value="${intoPersonnel.city !}" >
					<input id="city_combobox"  class="easyui-combobox inputBox theme-textbox-radius" style="width: 149px;height: 35px;text-align: center;"/>
					<input id="area_input" type="hidden" value="${intoPersonnel.area !}">
					<input id="area_combobox" name="intoPersonnel.area" class="easyui-combobox inputBox theme-textbox-radius" style="width: 149px;height: 35px;text-align: center;"/>
					<input id="address" class="easyui-textbox theme-textbox-radius" name="intoPersonnel.personnel_address" style="width: 148px;height: 35px;text-align: center;" value="${intoPersonnel.personnel_address !}"/>
				</li><br> -->	
				<li style="margin-left: 62px;">
					<label class="label-top">修改密码:</label>
					<a href="#" class="easyui-linkbutton button-blue button-sm" onclick="showPart()">
						<i id="outPersonnel"class="fa fa-check"></i> 点击设置
					</a>
				</li><br>
				<!-- <li style="margin-left:40%;">
					<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" style="width:173px" onclick="submitForm()">确定</a>
				</li> -->			
			</ul>
		</form>
		<script src="${cxt !}/sb/js/ajaxfileupload.js" type="text/javascript" charset="utf-8"></script>
		<script src="${cxt !}/sb/js/jquery.form.js" type="text/javascript" charset="utf-8"></script>
		<script>
		function showPart() {		
			loadDialog(null, null, '修改密码', '${cxt !}/personalInformation/alter?ids=' + "${user.ids! }",350,350);
		}
		//省份改变选择城市
		$('#xzqh_select').combobox({

			onChange: function (n,o) {
				getCity(n);
			},
		onSelect: function (n) 
		 {		
			 var newPtion = $('#xzqh_select').combobox('getValue');
			 getCity(newPtion);
		 }

		});
		//市改变选择区
		$('#city_combobox').combobox({

			onChange: function (n,o) {
				getArea(n);
			}
			
		});
		//获取城市
		function  getCity(n)
		{
			var url = "/bentryRegister/getChild";
			var data={"codeIds":n};
			var reData = common_ajax.ajaxFunc(url,data,"json");
			var city=$("#city_input").val();
			var com=$('#city_combobox');
			select(reData,com,city);
		}
		//获取区
		function  getArea(n)
		{
			var url = "/bentryRegister/getChild";
			var data={"codeIds":n};
			var reData = common_ajax.ajaxFunc(url,data,"json");
			var area=$("#area_input").val();
			var com=$('#area_combobox');
			select(reData,com,area);
		}
		function select(reData,com,info)
		{	
			com.combobox({
				  data:reData,
				  valueField:'ids', 
	          	  textField:'name',
		          onLoadSuccess: function () {
		        	  if(info!="")
						 {
							 var val = $(this).combobox('getData'); 
		        	  		  for(var i=0;i<val.length;i++)
		        	  		  {		
		        	  			  if(val[i].ids==info)
		        	  			  {
		        	  				$(this).combobox('select', val[i].ids); 
		        	  			  }
		        	  		  }
						 }else
						 {
							 var val = $(this).combobox('getData');  
	                         for (var item in val[0]) {  
	                             if (item == 'ids') {  
	                                 $(this).combobox('select', val[0][item]);  
	                             }  
	                         } 
						 }
		          }	
	            
			});
			
		}
		var submitNow=function($dialog, $grid, $tree, $pjq){
			var url = "${cxt !}/personalInformation/saveIntoPer";
			$.post(url, sy.serializeObject($('#personalInformationForm')),function(result){
				if(result.msg == "200"){
					$.slideMsg("修改成功！", $pjq);	
				}else{
					$.alert($pjq, result.msg);
				}
			},'json');
			
		} 
		var submitForm = function($dialog, $grid, $tree, $pjq) {

			/* var validate=$("#name").val()==""||$("#sex").val()==""||$("#birthday").val()==""||$("#height").val()==""
						||$("#weight").val()==""||$("#nation_select").val()==""||$("#zzmm_select").val()==""
						||$("#hyzk_select").val()==""||$("#jk_select").val()==""||$("#major").val()==""||$("#xl_select").val()==""
						||$("#jsj_select").val()==""||$("#school").val()==""||$("#idCard").val()==""
						||$("#phone").val()==""||$("#xzqh_select").val()==""||$("#city_combobox").val()==""
						||$("#area_combobox").val()==""||$("#address").val()==""; */
			var validate=$("#name").val()==""||$("#phone").val()=="";
			if(validate){
				$.alert(parent.$,"信息填写不完整，请完善信息");
			}else{
				submitNow($dialog, $grid, $tree, $pjq);
			}
		}
		   </script>	
	</body>
</html>
